﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Template.aspx.cs" Inherits="Common_Template" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v8.3" Namespace="DevExpress.Web.ASPxGridView"
    TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v8.3" Namespace="DevExpress.Web.ASPxEditors"
    TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.v8.3" Namespace="DevExpress.Web.ASPxCallbackPanel"
    TagPrefix="dxcp" %>
<%@ Register Assembly="DevExpress.Web.v8.3" Namespace="DevExpress.Web.ASPxPanel"
    TagPrefix="dxp" %>
<%@ Register Assembly="DevExpress.Web.ASPxTreeList.v8.3, Version=8.3.2.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
    Namespace="DevExpress.Web.ASPxTreeList" TagPrefix="dxwtl" %>
<%@ Register TagPrefix="dxrp" Namespace="DevExpress.Web.ASPxRoundPanel" Assembly="DevExpress.Web.v8.3" %>
<%@ Register Src="../UseControl/PageCommon.ascx" TagName="PageCommon" TagPrefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>模板</title>
    <script type="text/javascript" src="../Script/Common.js"></script>
</head>
<body>
    <form id="form1" runat="server">
        <dxcp:ASPxCallbackPanel ID="ajaxPanel" ClientInstanceName="ajaxPanel"
            LoadingPanelText="数据加载中…" OnCallback="ajaxPanel_Callback" runat="server" HideContentOnCallback="False">
            <PanelCollection>
                <dxp:PanelContent runat="server">
                    <div class="queryLine"></div>
                    <div class="buttonLine">
                        <uc1:PageCommon ID="commonPageCtrl" GridClientName="InfoGrid" OnExport="btnExport_Click" runat="server" >
                        </uc1:PageCommon>
                    </div>
                    <div class="infoGrid">
                        <dxwgv:ASPxGridView ID="InfoGrid" ClientInstanceName="InfoGrid" 
                            DataSourceID = "dataSource"
                            KeyFieldName="ID" Width="100%" runat="server"
                            OnCustomCallback="InfoGrid_CustomCallback"
                            OnRowDeleting="InfoGrid_RowDeleting"
                            OnRowValidating="InfoGrid_RowValidating" 
                            OnPreRender="InfoGrid_PreRender" AutoGenerateColumns="False" OnRowInserting="InfoGrid_RowInserting" OnRowUpdating="InfoGrid_RowUpdating"  >
                            <Columns>
                                <dxwgv:GridViewDataTextColumn FieldName="Name" VisibleIndex="0">
                                    <EditFormSettings ColumnSpan="2" />
                                </dxwgv:GridViewDataTextColumn>
                                <dxwgv:GridViewDataSpinEditColumn FieldName="Age" VisibleIndex="1">
                                </dxwgv:GridViewDataSpinEditColumn>
                                <dxwgv:GridViewDataTextColumn FieldName="Money" VisibleIndex="2">
                                </dxwgv:GridViewDataTextColumn>
                                <dxwgv:GridViewDataDateColumn FieldName="Birthday" VisibleIndex="3">
                                </dxwgv:GridViewDataDateColumn>
                                <dxwgv:GridViewDataComboBoxColumn FieldName="SexText" VisibleIndex="4">
                                    <EditItemTemplate>
                                    <dxe:ASPxComboBox ID="cbxSex" runat="server" DataSourceID="dsEnumSex" TextField="Name" Value='<%# Bind("SexText") %>'
                                                        ValueField="ID" ValueType="System.String">
                                                    </dxe:ASPxComboBox>
                                    </EditItemTemplate>
                                </dxwgv:GridViewDataComboBoxColumn>
                                <dxwgv:GridViewDataCheckColumn FieldName="IsInComp"  VisibleIndex="5">
                                </dxwgv:GridViewDataCheckColumn>
                                <dxwgv:GridViewDataComboBoxColumn FieldName="BelongCompany.CompanyName" VisibleIndex="6">
                                    <EditItemTemplate>
                                        <dxe:ASPxComboBox ID="cbxCompany" runat="server" DataSourceID="dsCompany" TextField="CompanyName" Value='<%# Bind("CompID") %>'
                                            EnableIncrementalFiltering="true" ValueField="CompanyID" ValueType="System.String">
                                        </dxe:ASPxComboBox>
                                    </EditItemTemplate>
                                </dxwgv:GridViewDataComboBoxColumn>
                                <dxwgv:GridViewDataMemoColumn  FieldName="Note" VisibleIndex="7">
                                    <EditFormSettings ColumnSpan="2" />
                                </dxwgv:GridViewDataMemoColumn>
                                <dxwgv:GridViewCommandColumn Caption="操作" VisibleIndex="8">
                                    <DeleteButton Text="删除" Visible="True">
                                    </DeleteButton>
                                    <EditButton Text="编辑" Visible="True">
                                    </EditButton>
                                </dxwgv:GridViewCommandColumn>
                            </Columns>
                            <ClientSideEvents CustomizationWindowCloseUp="function(s, e) { UpdateCustomizationWindowValue(); }" />
                       </dxwgv:ASPxGridView>
                    </div>
                </dxp:PanelContent>
            </PanelCollection>
        </dxcp:ASPxCallbackPanel>
        <asp:ObjectDataSource ID="dataSource" runat="server" DataObjectTypeName="OT.Module.Model.Emp_MDL"
            TypeName="OT.Module.BLL.Emp_BLL" 
            OnSelecting="dataSource_Selecting" SelectMethod="Select" 
            OnObjectCreating="ds_ObjectCreating">
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="dsEnumSex" runat="server" DataObjectTypeName="OT.Common.UIPage.Sex"
            OnObjectCreating="ds_EnumUtilityCreating" SelectMethod="Select"
            TypeName="OT.Common.Generic.EnumDataSource">
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="dsCompany" runat="server" DataObjectTypeName="OT.Module.Model.Company_MDL"
            TypeName="OT.Module.BLL.Company_BLL" 
            OnSelecting="dsCompany_Selecting" SelectMethod="Select" 
            OnObjectCreating="dsCompany_ObjectCreating">
        </asp:ObjectDataSource>
    </form>
</body>
</html>
